from django.db import models

# Create your models here.

class ToDoItem(models.Model):
    title = models.CharField(max_length=200, verbose_name="Название", null=False, blank=False)
    description = models.TextField(verbose_name="Описание", null=False, blank=True, default='')
    is_done = models.BooleanField(verbose_name="Завершено", null=False, blank=False, default=False)
    created_at = models.DateTimeField(auto_now_add=True)

    def __str__(self):
        return self.title

    class Meta:
        ordering = ["-created_at"]
        verbose_name = "Позиция в списке дел"
        verbose_name_plural = "Позиции в списке дел"